package org.wu.framework.authorization.platform.controller;

import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.web.multipart.MultipartFile;
import org.wu.framework.web.spring.EasyController;
import org.springframework.web.bind.annotation.*;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.springframework.beans.factory.annotation.Autowired;
import jakarta.annotation.Resource;
import org.wu.framework.authorization.platform.domain.model.lazy.zone.application.LazyZoneApplication;
import org.wu.framework.authorization.platform.application.command.lazy.zone.application.LazyZoneApplicationRemoveCommand;
import org.wu.framework.authorization.platform.application.command.lazy.zone.application.LazyZoneApplicationStoryCommand;
import org.wu.framework.authorization.platform.application.command.lazy.zone.application.LazyZoneApplicationUpdateCommand;
import org.wu.framework.authorization.platform.application.command.lazy.zone.application.LazyZoneApplicationQueryListCommand;
import org.wu.framework.authorization.platform.application.command.lazy.zone.application.LazyZoneApplicationQueryOneCommand;
import org.wu.framework.authorization.platform.application.LazyZoneApplicationApplication;
import org.wu.framework.authorization.platform.application.dto.LazyZoneApplicationDTO;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
/**
 * describe 应用信息 
 *
 * @author Jia wei Wu
 * @date 2024/04/02 06:21 晚上
 * @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyController 
 **/
@Tag(name = "应用信息提供者")
@EasyController("/lazy/zone/application")
public class LazyZoneApplicationProvider  {

    @Resource
    private LazyZoneApplicationApplication lazyZoneApplicationApplication;

    /**
     * describe 新增应用信息
     *
     * @param lazyZoneApplicationStoryCommand 新增应用信息     
     * @return {@link Result<LazyZoneApplication>} 应用信息新增后领域对象     
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "新增应用信息")
    @PostMapping("/story")
    public Result<LazyZoneApplication> story(@RequestBody LazyZoneApplicationStoryCommand lazyZoneApplicationStoryCommand){
        return lazyZoneApplicationApplication.story(lazyZoneApplicationStoryCommand);
    }
    /**
     * describe 批量新增应用信息
     *
     * @param lazyZoneApplicationStoryCommandList 批量新增应用信息     
     * @return {@link Result<List<LazyZoneApplication>>} 应用信息新增后领域对象集合     
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "批量新增应用信息")
    @PostMapping("/batchStory")
    public Result<List<LazyZoneApplication>> batchStory(@RequestBody List<LazyZoneApplicationStoryCommand> lazyZoneApplicationStoryCommandList){
        return lazyZoneApplicationApplication.batchStory(lazyZoneApplicationStoryCommandList);
    }
    /**
     * describe 更新应用信息
     *
     * @param lazyZoneApplicationUpdateCommand 更新应用信息     
     * @return {@link Result<LazyZoneApplication>} 应用信息领域对象     
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "更新应用信息")
    @PutMapping("/updateOne")
    public Result<LazyZoneApplication> updateOne(@RequestBody LazyZoneApplicationUpdateCommand lazyZoneApplicationUpdateCommand){
        return lazyZoneApplicationApplication.updateOne(lazyZoneApplicationUpdateCommand);
    }
    /**
     * describe 查询单个应用信息
     *
     * @param lazyZoneApplicationQueryOneCommand 查询单个应用信息     
     * @return {@link Result<LazyZoneApplicationDTO>} 应用信息DTO对象     
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "查询单个应用信息")
    @GetMapping("/findOne")
    public Result<LazyZoneApplicationDTO> findOne(@ModelAttribute LazyZoneApplicationQueryOneCommand lazyZoneApplicationQueryOneCommand){
        return lazyZoneApplicationApplication.findOne(lazyZoneApplicationQueryOneCommand);
    }
    /**
     * describe 查询多个应用信息
     *
     * @param lazyZoneApplicationQueryListCommand 查询多个应用信息     
     * @return {@link Result<List<LazyZoneApplicationDTO>>} 应用信息DTO对象     
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "查询多个应用信息")
    @GetMapping("/findList")
    public Result<List<LazyZoneApplicationDTO>> findList(@ModelAttribute LazyZoneApplicationQueryListCommand lazyZoneApplicationQueryListCommand){
        return lazyZoneApplicationApplication.findList(lazyZoneApplicationQueryListCommand);
    }
    /**
     * describe 分页查询多个应用信息
     *
     * @param lazyZoneApplicationQueryListCommand 分页查询多个应用信息     
     * @return {@link Result<LazyPage<LazyZoneApplicationDTO>>} 分页应用信息DTO对象     
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "分页查询多个应用信息")
    @GetMapping("/findPage")
    public Result<LazyPage<LazyZoneApplicationDTO>> findPage(@Parameter(description ="分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
                           @Parameter(description ="当前页数") @RequestParam(defaultValue = "1", value = "current") int current,@ModelAttribute LazyZoneApplicationQueryListCommand lazyZoneApplicationQueryListCommand){
        return lazyZoneApplicationApplication.findPage(size,current,lazyZoneApplicationQueryListCommand);
    }
    /**
     * describe 删除应用信息
     *
     * @param lazyZoneApplicationRemoveCommand 删除应用信息     
     * @return {@link Result<LazyZoneApplication>} 应用信息     
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "删除应用信息")
    @DeleteMapping("/remove")
    public Result<LazyZoneApplication> remove(@ModelAttribute LazyZoneApplicationRemoveCommand lazyZoneApplicationRemoveCommand){
        return lazyZoneApplicationApplication.remove(lazyZoneApplicationRemoveCommand);
    }
}